﻿<%@ page language="java" contentType="text/html;charset=utf-8" pageEncoding="utf-8"%>

<%@ include file="/core/taglibs.jsp"%>
<!DOCTYPE html>
<html lang="en" class="app">
<head>
	<meta charset="utf-8" />
	<title>紅花（香港）集團-众艾车代理商管理系统</title>
	<meta name="description" content="app, web app, responsive, admin dashboard, admin, flat, flat ui, ui kit, off screen nav" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
	<%@ include file="/core/memberZong.jsp" %>

	<script type="text/javascript">
        $(function() {
            $('#submit').click(function() {
                var checkSubmitFlg = true;
                if ($("#activeLoginName").val() != $("#loginName").val() ) {
                    alert("要报单的代理商号不正确。");

                    checkSubmitFlg= false;
                }
                if ($("#myTwoPassword").val() == "") {
                    alert("请输入安全密码。");
                    checkSubmitFlg= false;
                }
                if(checkSubmitFlg==true){

                    var this_ = this;
                    this_.setAttribute("disabled", true);
                    this_.value="请稍等，提交中...";
                    $.ajax({
                        url: '<%=basePath%>/member/member/memberActive.shtml',
                        type: 'post',
                        dataType:'json',
                        data: $("#commitForm").serializeArray(),
                        success: function(result) {
                            if(result.success==true){
                                alert("恭喜您，代理商报单成功。");
                                window.location.href="<%=basePath%>/member/member/memberYesActiveList.shtml";
                            } else {
                                alert("报单失败。" + result.msg);
                                location.reload();//刷新页面
                            }
                            //放到回调里
                            this_.removeAttribute("disabled");
                            this_.value = "提  交";
                        }
                    });
                }
            });
        });
	</script>

</head>
<body>
<section class="vbox">

	<section>
		<section class="hbox stretch">
			<section id="content1">
				<section class="vbox">
					<section class="scrollable padder">

						<div class="m-b-md">
							<h3 class="m-b-none">报单代理商</h3>
						</div>
						<section class="panel panel-default">
							<header class="panel-heading font-bold"> 报单代理商 </header>
							<div class="panel-body">
								<form class="form-horizontal" id="commitForm" name="commitForm" method="post">
									<input type="hidden" id="loginName" name="loginName" value="${member.loginName}" />
									<input type="hidden" name="token" value="${token}" />
									<jodd:form scopes="request" beans="member">
									<div class="line line-dashed line-lg pull-in"></div>
									<div class="form-group">
										<label class="col-sm-2 control-label">代理商编号：</label>
										<div class="col-sm-10">
												${member.loginName}
										</div>
									</div>

										<div class="line line-dashed line-lg pull-in"></div>
										<div class="form-group">
											<label class="col-sm-2 control-label">推荐人编号:</label>
												${member.recommendLoginName}
											<div class="col-sm-10">
											</div>
										</div>

										<div class="line line-dashed line-lg pull-in"></div>
										<div class="form-group">
											<label class="col-sm-2 control-label">姓名:</label>
												${member.personName}
											<div class="col-sm-10">
											</div>
										</div>

										<div class="line line-dashed line-lg pull-in"></div>
										<div class="form-group">
											<label class="col-sm-2 control-label">选择报单积分种：</label>
											<div class="col-sm-10">
												<select type="select" class="form-control m-b" id="activeType" name="activeType" onchange="product()">
													<option value="10">奖金积分</option>
													<option value="20">报单积分</option>
												</select>

											</div>
										</div>

										<div class="line line-dashed line-lg pull-in"></div>
										<div class="form-group">
											<label class="col-sm-2 control-label">确认代理商账号:</label>
											<div class="col-sm-10">
												<input type="text" id="activeLoginName" name="activeLoginName" class="form-control" placeholder="确认代理商账号">
											</div>
										</div>

										<div class="line line-dashed line-lg pull-in"></div>
										<div class="form-group">
											<label class="col-sm-2 control-label">安全密码:</label>
											<div class="col-sm-10">
												<input type="password" id="myTwoPassword" name="myTwoPassword" class="form-control" placeholder="安全密码">
											</div>
										</div>

										<div class="line line-dashed line-lg pull-in"></div>
										<div class="form-group">
											<div class="col-sm-4 col-sm-offset-2">
													${retMsg}
											</div>
										</div>

									<div class="line line-dashed line-lg pull-in"></div>
									<div class="form-group">
										<div class="col-sm-4 col-sm-offset-2">
											<%--<button type="submit" class="btn btn-default">Cancel</button>--%>
											<button type="button" id="submit" name="submit" class="btn btn-primary">提交</button>
										</div>
									</div>

									</jodd:form>
								</form>
							</div>
						</section>
					</section>
				</section>

			</section>
		</section>
	</section>

</section>
</body>
</html>